﻿using System.IO;

namespace Super.Hmi.Global
{
    public static class FilePath
    {
        private static string BaseFilePath { get; } = AppDomain.CurrentDomain.BaseDirectory; // 应用程序根目录
        /// <summary>
        /// HandyControl 主题资源字典的基础 URI
        /// </summary>
        public static string BaseThemeUri { get; } = "pack://application:,,,/HandyControl;component/";
        private static string _themeFilePath = BaseFilePath + "Setting/"; // 主题配置文件路径
        private static string _configFilePath = BaseFilePath + "Config/"; // 配置文件路径
        private static string _chatGptFilePath = BaseFilePath + "ChatGptLog/"; // ChatGPT 日志文件路径
        private static string _gravatarFilePath = BaseFilePath + "Gravatar/"; // Gravatar 图片存储路径
        public static string LocalUserDataFilePath { get; } = _configFilePath + "LocalUser.json";    // 记住密码 本地用户记录 
        public static string ThemeSettingFilePath { get; } = ThemeFilePath + "Super.Hmi.Setting.json";     // 本地主题配置
        public static string ThemeSettingRecommendFilePath { get; } = ThemeFilePath + "Super.Hmi.Setting.Recommend.json";     // 本地推荐主题配置
        public static string ThemeUri { get; } = $"{FilePath.BaseThemeUri}Themes/Theme.xaml"; // HandyControl 主题字典
        public static string DarkThemeUri { get; } = $"{FilePath.BaseThemeUri}Themes/SkinDark.xaml"; // HandyControl SkinDark 主题字典
        public static string DefualtThemeUri { get; } = $"{FilePath.BaseThemeUri}Themes/SkinDefault.xaml"; // HandyControl SkinDefault 主题字典
        /// <summary>
        /// ChatGptNowLog 日志路径
        /// </summary>
        public static string ChatGptNowLog
        {
            get
            {
                string path = $"{ChatGptFilePath}/{DateTime.Now.ToString("yyyyMMdd")}/";
                if (!Directory.Exists(path))
                    Directory.CreateDirectory(path);
                return path;
            }
        }
        /// <summary>
        /// 主题配置文件路径
        /// </summary>
        public static string ThemeFilePath
        {
            get
            {
                if (!Directory.Exists(_themeFilePath))
                    Directory.CreateDirectory(_themeFilePath);
                return _themeFilePath;
            }
        }
        /// <summary>
        /// 配置文件路径
        /// </summary>
        public static string ConfigFilePath
        {
            get
            {
                if (!Directory.Exists(_configFilePath))
                    Directory.CreateDirectory(_configFilePath);
                return _configFilePath;
            }
        }
        /// <summary>
        /// ChatGPT 日志文件路径
        /// </summary>
        public static string ChatGptFilePath
        {
            get
            {
                if (!Directory.Exists(_chatGptFilePath))
                    Directory.CreateDirectory(_chatGptFilePath);
                return _chatGptFilePath;
            }
        }
        /// <summary>
        /// Gravatar 图片存储路径
        /// </summary>
        public static string GravatarFilePath
        {
            get
            {
                if (!Directory.Exists(_gravatarFilePath))
                    Directory.CreateDirectory(_gravatarFilePath);
                return _gravatarFilePath;
            }
        }
    }
}
